home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / theama_1 / readme.txt < prev   
Encoding:
Text File  |  1999-08-17  |  1.2 KB  |  29 lines

  1. The amazing Binary Shift in Visual Basic
  2. ========================================
  3.  
  4. I'm sure it's been done before. But before, it was for a price... :)
  5.  
  6. What you should find with this text document is BS.dll, and BS.bas. The DLL contains the functions for binary shifting, and the VB module contains the function declarations.
  7.  
  8.  
  9. BSx (Number As Long, Amount As Integer) As Long
  10.  
  11. Parameters:
  12.  
  13.     Number - the number on which you wish to perform the binary shift
  14.  
  15.     Amount - how many steps you wish to shift the number
  16.  
  17. Return Values:
  18.  
  19.     Function returns the value of Number << or >> Amount.
  20.  
  21.  
  22. Also with this document there should be a test application showing off the speed of the binary
  23. shifting as opposed to VB division and another text file I wrote to explain binary shifting. Binary shifting turned out to be around about 1/3 faster. This may not sound like a lot, but in a processing time expensive game, this DLL COULD mean the difference between a nice and fast 30fps game, or a horrible slow 5fps game (Believe me, I know these things... ;)).
  24.  
  25. Enjoy!
  26.  
  27.  
  28. NOTE:
  29. BEFORE YOU OPEN THE VB PROJECT OR RUN IT, YOU WILL NEED TO COPY THE DLL AND BAS FILE TO THE BSTEST DIRECTORY.